<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outer {
            width: 300px;
            height: 300px;
            background-color: red;
            text-align: center;
            padding: 50px;
        }
        .inner {
            width: 100px;
            height: 100px;
            background-color: yellow;
        }
    </style>
</head>
<body>
    <div class="outer">
        <div class="inner"></div>
    </div>
    <script>
        // useCapture  false  true  事件在那个阶段执行
        document.querySelector('.outer').addEventListener('click', () => {
            console.log('捕获事件'); // 先
        }, true);
        document.querySelector('.inner').addEventListener('click', () => {
            console.log('目标事件');
        });
        document.querySelector('.outer').addEventListener('click', () => {
            console.log('冒泡事件');
        });
    </script>
</body>
</html>